package com.lostandfound.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**  
* 
*  
* @date 2018年3月11日
*/
@Entity
@Table(name = "laf_plate_t")
public class Plate implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long pid;//ID
	private String pname;//板块名
	private String pdescription;//描述
	private Date p_create_time;//创建时间
	private Date p_modify_time;//修改时间
	private String pstatus = "0";//0正常，1删除
	private User user;//创建者
	
	public Plate(){}
	
	public Plate(String pname, String pdescription, Date p_create_time, Date p_modify_time, String pstatus,
			User user) {
		super();
		this.pname = pname;
		this.pdescription = pdescription;
		this.p_create_time = p_create_time;
		this.p_modify_time = p_modify_time;
		this.pstatus = pstatus;
		this.user = user;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "p_id", unique = true, nullable = false, length = 8)
	public Long getPid() {
		return pid;
	}
	public void setPid(Long pid) {
		this.pid = pid;
	}
	
	@Column(name = "p_name",nullable = false, length = 16)
	public String getPname() {
		return pname;
	}
	public void setPname(String pname) {
		this.pname = pname;
	}
	
	@Column(name = "p_description",nullable = false, length = 64)
	public String getPdescription() {
		return pdescription;
	}
	public void setPdescription(String pdescription) {
		this.pdescription = pdescription;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "p_create_time", length = 7)
	public Date getP_create_time() {
		return p_create_time;
	}
	public void setP_create_time(Date pcreate_time) {
		this.p_create_time = pcreate_time;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "p_modify_time", length = 7)
	public Date getP_modify_time() {
		return p_modify_time;
	}
	public void setP_modify_time(Date pmodify_time) {
		this.p_modify_time = pmodify_time;
	}
	
	@Column(name = "p_status",nullable = false, length = 1)
	public String getPstatus() {
		return pstatus;
	}
	public void setPstatus(String pstatus) {
		this.pstatus = pstatus;
	}
	
	@ManyToOne
	@JoinColumn(name="id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}

}
